#ifndef NEW_GRAPH_H
#define NEW_GRAPH_H

#include <string>
#include "graph.h"
#include "DecoratedNodeType.h"

class VariableInfo
{
public:
	NodeTypeInterface * type;
	int value; //TODO: we dont support non-integer values, should be done later (maybe by making it a decorator also)
	bool set:1;
	bool unsupported_value:1;

	VariableInfo(NodeTypeInterface * type)
	{
		this->type=type;
		this->value=0;
		set=false;
		unsupported_value=false;

	}
	VariableInfo(NodeTypeInterface * type,int value)
	{
		this->type=type;
		this->value=value;
		set=true;
		unsupported_value=false;
	}
	void setValue(int val)
	{
		value=val;
		set=true;
		unsupported_value=false;
	}
};

typedef map<string, VariableInfo> VariablesMap;
typedef pair<string, VariableInfo > VariablesPair;

class NewGraph: public ProgGraph<NodeTypeInterface *, Label>
{
public:
	VariablesMap varMap;
	
	NewGraph::ProgNode * getChild(NewGraph::ProgNode * node, Label l)
	{
		list<ProgEdge*> & edges = node->edges;
        ProgEdgeIter it = edges.begin();
        for (; it != edges.end(); it++) 
        {
            ProgEdge * edge = *it;
            if (edge->weight==l)
            	return &(edge->to);
		}
		return NULL;
	}
};

#endif
